<?php
	####################################################
	# CharacterGenerate 문자 생성                      #
	####################################################

	class CharacterGenerate {

		# 랜덤문자 출력
		public static function get_rand_str($no){
			$array = array();
			for($idx=1;$idx<10;$idx++){
				$array[] = $idx;
				$array[] = $idx;
			}
			$text = "a";
			$array[] = $text;
			for($idx=1;$idx<26;$idx++){
				$text++;
				if($text=='o') continue;
				if($text=='l') continue;
				$array[] = $text;
			}
			$RetVal = "";
			for($idx=0;$idx<$no;$idx++){
				shuffle($array);
				$RetVal .= $array[0];
			}
			return $RetVal;
		}

		# 랜덤숫자 출력
		public static function get_rand_num(){
			$ret = rand(1111,9999);
			return $ret;
		}

		# 랜덤값 생성
		public static function random_string($length) {
			$randomcode = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'A', 'B', 'C', 'd', 'E', 'F', 'G', 'H', 'x', 'J', 'K', 'b', 'M', 'N', 'y', 'P', 'r', 'R', 'S', 'T', 'u', 'V', 'W', 'X', 'Y', 'Z');
			mt_srand((double) microtime() * 1000000);
			for ($i = 1; $i <= $length; $i++) $Rstring .= $randomcode[mt_rand(1, 36)];
			return $Rstring;
		}

		# 15자리의 유일한 숫자값 만들기
		public static function uniquenumber() {
			$temparray = explode(" ", microtime());
			$temparray2 = substr($temparray[0], 2, 5);
			$number = $temparray[1].$temparray2;
			return $number;
		}

		# 모든 한글의 글자를 출력
		public static function hangul_code_print() {
			$count = 0;
			for ($i = 0x81; $i <= 0xC8; $i++) {
				for ($j = 0x00; $j <= 0xFE; $j++) {
					if (($j >= 0x00 && $j <= 0x40) || ($j >= 0x5B && $j <= 0x60) || ($j >= 0x7B && $j <= 0x80) || ($j >= 0x00 && $j <= 0x40) || (($i >= 0xA1 && $i <= 0xAF) && ($j >= 0xA1 && $j <= 0xFE)) || ($i == 0xC6 && ($j >= 0x53 && $j <= 0xA0)) || ($i >= 0xC7 && ($j >= 0x41 && $j <= 0xA0))) continue;
					echo chr($i).chr($j)." ";
					$count++;
				}
			}
			echo $count;
		}

	}

?>